package com.itheima.day14.xianchengchi;

import java.util.concurrent.*;

public class Test {

    public static void main(String[] args) {
        MyRunnable r = new MyRunnable();
        ExecutorService es = new ThreadPoolExecutor(
                2,
                5,
                1000,
                TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(3),
                Executors.defaultThreadFactory(),
        new ThreadPoolExecutor.AbortPolicy()
                );
        es.execute(r);
        es.execute(r);

//        new Thread(r,"小红").start();
//        new Thread(r,"小明").start();
    }
}
